<?php
declare (strict_types = 1);

namespace app\common\validate;

use think\Validate;
class StudyStudentLeave extends Validate
{
    protected $rule = ['student_id' => 'require|number','add_time' => 'require|number','start_time' => 'require|number','end_time' => 'require|number','level_day' => 'require|number','leave_type' => 'require','leave_info' => 'require',
    ];

    protected $message = ['student_id.require' => '学生id为必填项','student_id.number' => '学生id需为数字','add_time.require' => '申请时间为必填项','add_time.number' => '申请时间需为数字','start_time.require' => '开始时间为必填项','start_time.number' => '开始时间需为数字','end_time.require' => '结束时间为必填项','end_time.number' => '结束时间需为数字','level_day.require' => '请假天数为必填项','level_day.number' => '请假天数需为数字','leave_type.require' => '请假类型为必填项','leave_info.require' => '请假说明为必填项',
    ];

    /**
     * 添加
     */
    public function sceneAdd()
    {
        return $this->only(['student_id','add_time','start_time','end_time','level_day','leave_type','leave_info',]);
    }

    /**
     * 编辑
     */
    public function sceneEdit()
    {
        return $this->only(['student_id','add_time','start_time','end_time','level_day','leave_type','leave_info',]);
    }
}
